import java.util.HashMap;
import java.util.Map;

/**
 * @Author: zhs
 * @Date: 2021/5/20 10:40
 * @Description:
 */
public class HttpParamUtils {

    public static String httpGetParam(Map<String,Object> map){
        if(map != null && !map.isEmpty()){
            String param = "?";
            for(String key:map.keySet()){
                param += key + "=" + map.get(key) + "&";
            }
            return param.substring(0,param.length()-1);
        }
        return "";
    }

    public static void main(String[] args) {
        Map<String,Object> map = new HashMap<>();
        map.put("key","aaaa");
        System.err.println("https://xxxx.com" + httpGetParam(map));
    }
}